import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base:'./',
  server: {
    open: true,//启动项目自动弹出浏览器
    port: 8080,
    proxy: {
      '/api': {
        target: 'http://10.1.6.130',
      //  target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '/api') // 不可以省略rewrite
      },
       '/icons': {
      target: 'http://10.1.6.130',
       //  target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/icons/, '/icons') // 不可以省略rewrite
      },
       '/stutasks': {
      target: 'http://10.1.6.130',
       //  target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/stutasks/, '/stutasks') // 不可以省略rewrite
      }
    }
  }
}) 
